package com.zui.entity.party;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.zui.entity.BaseAssignedIdEntity;


@Entity
@Table(name="party_type")
public class PartyType extends BaseAssignedIdEntity {
	private static final long serialVersionUID = 1L;
	
	public static final String TYPE_PARTY_GROUP = "PARTY_GROUP";
	public static final String TYPE_PERSON = "PERSON";
	public static final String HABOO_SUPPLIER = "HABOO_SUPPLIER";
	
	
	public PartyType() {}
	public PartyType(String id) {this.id = id;}
	
	private String name;
	private PartyType parentPartyType;

	/*------------------------------
	 * getters and annotations
	 --------------------------------*/
	@Column(length=20)
	public String getName() {return name;}
	
	@OneToOne
	@JoinColumn(name="parentPartyTypeId")
	public PartyType getParentPartyType() {return parentPartyType;}


	public void setName(String name) {
		this.name = name;
	}

	public void setParentPartyType(PartyType parentPartyType) {
		this.parentPartyType = parentPartyType;
	}
}
